<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head lang="zh-CN">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>用戶列表</title>
 <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet"/>
 <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
 <link href="/lib/layer/theme/default/layer.css" rel="stylesheet"/>
 
 <script src="https://cdn.bootcss.com/jquery/3.2.0/jquery.min.js"></script>
 <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
 <script src="/lib/layer/layer.js"></script>
 <script src="/js/common.js"></script>
<style type="text/css">
.panel{
	text-align:center;
	background:#ff0;
	width:600px;
	align:center;
}
</style>
</head>
<body>
<div class="container">
  <div class="panel">
  	<form id="formList" class="form-group" action="/login/in" method="post">
  		<label for="userName">名称</label>
  		<input type="text" id="userName" name="userName" class="form-control"/>
  		<label for="passWd">密码</label>
  		<input type="text" id="passWd" name="passWd" class="form-control"/>
  	</form>
  	<button type="submit" id="login" class="btn btn-success" onclick="addForm()">登录</button>
  </div>
</div>
<script>
function addForm(){
	$.ajax({
        url:"/login/in",
        type:"post",
        data:{
        	userName:$("#userName").val(),
        	passWd:$("#passWd").val(),
        },
        success:function(result){
            if(result.status==0)
            	window.location.href = '/login/main';
            else
            	layer.msg("创建失败");
        },
        error:function(e){
            alert("错误！！");
            window.clearInterval(timer);
        }
    });        
}
</script>
</body>
</html>